import { ref } from 'vue'
import { InfoApi } from './api'

export class InfoClass {
	info = ref()
	constructor() {
		this.getInfo()
	}

	/**
	 * 获取个人信息
	 */
	public getInfo() {
		InfoApi.getUserInfo().subscribe(res => {
			this.info.value = res
		})
	}

	public github() {
		window.open(this.info.value.githuburl)
	}
	public gitee() {
		window.open(this.info.value.giteeurl)
	}
	public zh() {
		window.open(this.info.value.zhurl)
	}
	public csdn() {
		window.open(this.info.value.csdnurl)
	}
}
